home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Internet / WWW / Perl_WWW_Utilities / total / ssi_image / README next >
Encoding:
Text File  |  1996-01-02  |  7.1 KB  |  156 lines

  1. ##############################################################################
  2. # Server Side Includes Random Image Displayer
  3. # Created by: Matt Wright
  4. # Version 1.2
  5. # Created On: 7/1/95            Last Modified: 11/4/95
  6. # I can be reached at:  mattw@misha.net
  7. # Scripts located at:   http://worldwidemart.com/scripts/
  8. ##############################################################################
  9. # If you run into any problems while trying to configure this scripts, help  #
  10. # is available.  The steps you should take to get the fastest results, are:  #
  11. #       1) Read this file thoroughly                         #
  12. #       2) Consult the Matt's Script Archive Frequently Asked Questions:     #
  13. #               http://www.worldwidemart.com/scripts/faq/                 #
  14. #       3) If you are still having difficulty installing this script, send   #
  15. #          e-mail to: scripts-help@tahoenet.com                     #
  16. #          Include any error messages you are receiving and as much detail   #
  17. #          as you can so we can spot your problem.  Also include the variable#
  18. #          configuration block that is located at the top of the script.     #
  19. #                                         #
  20. # Hopefully we will be able to help you solve your problems.  Thank you.     #
  21. ##############################################################################
  22.  
  23. This script is provided to allow you to have a random image appear on your 
  24. page every time it is reloaded.  The server side includes version offers you 
  25. link flexibility as well as coinciding random alt text and other variables 
  26. which make it slightly more advanced than the Basic Random Image Displayer.
  27.  
  28. There are two files included with this script.
  29.         1) README - This file, which explains installation
  30.         2) ssi_rand_image.pl - The perl script which chooses the random image.
  31.  
  32. Below is a list of the changes that must be made to the ssi_rand_image.pl file 
  33. in order for it to choose your random images correctly:
  34.  
  35. Inside the script you will see a list of variables, which must be defined in 
  36. order for your script to work.  Below is a description of how to define each 
  37. one:
  38.  
  39. $basedir = "http://your.host.xxx/path/to/images/";
  40.  
  41.         The standard portion of my url for each image.  This is the base 
  42. location of each image that is referenced in the next array @images. The 
  43. random image name chosen out of @images will be appended later on in the 
  44. script to form a complete url.
  45.  
  46. @images = ("first_image.gif","second_image.jpg","third_image.gif");
  47.  
  48.         This is the name of each image.  They can be whatever format you would 
  49. like, just make sure that when each of these filenames is appended to 
  50. $basedir, they form a complete url path to the image.
  51.  
  52. @urls = ("http://url_linked/to/first_image",
  53.          "http://url_linked/to/second_image",
  54.          "http://url_linked/to/third_image");
  55.  
  56.         If you want each image to be accompanied with a link, then this is 
  57. your chance to do it.  If you leave a field blank, then the script will assume 
  58. you do not have a url for that image and it will not link the image to 
  59. anything.  So therefore, if you did not have a link for the second image in 
  60. the example above you could do:
  61.  
  62.         @urls = ("http://url_linked/to/first_image",
  63.                  "",
  64.                  "http://url_linked/to/third_image");
  65.  
  66. @alt = ("First WWW Page","Second WWW Page","Third WWW Page");
  67.  
  68.         This is the same idea as the @urls array.  Each of these alt text fields 
  69. corresponds to the image located in the same array spot in @images, as well 
  70. as the same url located in the @urls array.  If you don't want the alt text 
  71. for a certain image just leave the field blank as in the example of @urls 
  72. above.
  73. ---
  74.  
  75. There are also a number of options that you will need to define and decide 
  76. whether to use.  They are located directly below the variables in the 
  77. ssi_rand_image.pl script.
  78.  
  79. $uselog = "1";            # 1 = YES; 0 = NO
  80.  
  81.         At this point you must decide whether or not you want to use the 
  82. logging feature.  for most practical purposes this will not be used, but some 
  83. people may find it helpful either for keeping stats or seeing which images get 
  84. picked the most.  All the logging feature will record is the image, date, and 
  85. remote host that saw the image.  Should you choose to turn this option on, you 
  86. will need to define two more variables:
  87.  
  88.    $logfile = "/home/mattw/public_html/links/ssi_image";
  89.                 The location of the log file.  This must be in a 
  90.         readable/writable directory and given read/write permissions for all 
  91.         users so that the server's uid may edit the log file.
  92.    $date = `/usr/bin/date`; chop($date);
  93.                 This is the location of your date function enclosed in '`' so 
  94.         that it will be executed when it is called upon.  It returns the date 
  95.         function for logging purposes only.
  96.  
  97. $link_image = "1";        # 1 = YES; 0 = NO
  98.  
  99.         If you turn this variable off you do not need to worry about what is 
  100. in the @urls variable.  It simply won't link any of your images.
  101.  
  102. $align = "left";
  103.  
  104.         This is the way in which you want your image aligned.  Valid choices 
  105. for Netscape include: left, right, middle, absmiddle, bottom, and absbottom.
  106.  
  107. $border = "2";
  108.  
  109.         This is the size you want your border to be.  Mainly occurs when you 
  110. have images linked the border turns blue, and in Netscape you can control the 
  111. size.  Setting this to zero causes there to be no border.
  112.  
  113. You can turn off both align and border by setting them equal to "" like:
  114. $align = ""; or $border = "";
  115. _____________________________________________________________________________
  116.  
  117. Server Side Includes
  118.  
  119. I hope that you already know how to accomplish a Server Side Includes, and 
  120. therefore I am not going to go into detail about how.  Two things you can 
  121. check for are:
  122.  
  123. 1) Ask your sysadmin if you have access to server side includes and what you 
  124. need to change about your file to make them work.  This often involves 
  125. changing your .html files to .shtml.
  126.  
  127. 2) If you really don't know anything about Server Side Includes, you can 
  128. check out a great tutorial that NCSA has developed;  located at:
  129.  
  130.         http://hoohoo.ncsa.uiuc.edu/docs/tutorials/includes.html
  131.  
  132. ________________________________________________________________________
  133.  
  134. HISTORY:
  135. Version 1.1:    9/30    - Corrections made to random image displayer to 
  136.               add functionality of alt text, links, etc... 
  137.               to each random image..
  138. Version 1.2:    11/4    - Errors in alt="" tag not being noticed 
  139.               correctly, and spacing being messed up fixed!
  140.  
  141. ________________________________________________________________________
  142.  
  143. The Random Image Script was written to be useful, and comes with no 
  144. warranties, express or implied.  You can use this script freely, however you 
  145. want.  You can modify it however you like, I would just ask two things:
  146.  
  147. 1) Register it with me when you use it:  This means send me the url of where 
  148. it is implemented.  It can be done through the on-line form located at:
  149.         http://worldwidemart.com/scripts/implement.html
  150.  
  151. 2) Keep my name in the scripts (and possibly on the html page) somewhere.
  152.  
  153. And last of all, ENJOY THE SCRIPT!
  154. ________________________________________________________________________
  155. Matt Wright - mattw@misha.net - http://www.worldwidemart.com/scripts/
  156.